<!doctype html>

<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>draglistgroup.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>

<div class="clear"></div>

<h2><a href="closure_goog_fx_draglistgroup.js.html">draglistgroup.js</a></h2>

<pre class="prettyprint lang-js">
<a name="line1"></a>// Copyright 2008 The Closure Library Authors. All Rights Reserved.
<a name="line2"></a>//
<a name="line3"></a>// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
<a name="line4"></a>// you may not use this file except in compliance with the License.
<a name="line5"></a>// You may obtain a copy of the License at
<a name="line6"></a>//
<a name="line7"></a>//      http://www.apache.org/licenses/LICENSE-2.0
<a name="line8"></a>//
<a name="line9"></a>// Unless required by applicable law or agreed to in writing, software
<a name="line10"></a>// distributed under the License is distributed on an &quot;AS-IS&quot; BASIS,
<a name="line11"></a>// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<a name="line12"></a>// See the License for the specific language governing permissions and
<a name="line13"></a>// limitations under the License.
<a name="line14"></a>
<a name="line15"></a>/**
<a name="line16"></a> * @fileoverview A DragListGroup is a class representing a group of one or more
<a name="line17"></a> * &quot;drag lists&quot; with items that can be dragged within them and between them.
<a name="line18"></a> *
<a name="line19"></a> * @see ../demos/draglistgroup.html
<a name="line20"></a> */
<a name="line21"></a>
<a name="line22"></a>
<a name="line23"></a>goog.provide(&#39;goog.fx.DragListDirection&#39;);
<a name="line24"></a>goog.provide(&#39;goog.fx.DragListGroup&#39;);
<a name="line25"></a>goog.provide(&#39;goog.fx.DragListGroup.EventType&#39;);
<a name="line26"></a>goog.provide(&#39;goog.fx.DragListGroupEvent&#39;);
<a name="line27"></a>
<a name="line28"></a>goog.require(&#39;goog.asserts&#39;);
<a name="line29"></a>goog.require(&#39;goog.dom&#39;);
<a name="line30"></a>goog.require(&#39;goog.dom.NodeType&#39;);
<a name="line31"></a>goog.require(&#39;goog.dom.classes&#39;);
<a name="line32"></a>goog.require(&#39;goog.events.Event&#39;);
<a name="line33"></a>goog.require(&#39;goog.events.EventHandler&#39;);
<a name="line34"></a>goog.require(&#39;goog.events.EventTarget&#39;);
<a name="line35"></a>goog.require(&#39;goog.events.EventType&#39;);
<a name="line36"></a>goog.require(&#39;goog.fx.Dragger&#39;);
<a name="line37"></a>goog.require(&#39;goog.fx.Dragger.EventType&#39;);
<a name="line38"></a>goog.require(&#39;goog.math.Coordinate&#39;);
<a name="line39"></a>goog.require(&#39;goog.style&#39;);
<a name="line40"></a>
<a name="line41"></a>
<a name="line42"></a>
<a name="line43"></a>/**
<a name="line44"></a> * A class representing a group of one or more &quot;drag lists&quot; with items that can
<a name="line45"></a> * be dragged within them and between them.
<a name="line46"></a> *
<a name="line47"></a> * Example usage:
<a name="line48"></a> *   var dragListGroup = new goog.fx.DragListGroup();
<a name="line49"></a> *   dragListGroup.setDragItemHandleHoverClass(className1, className2);
<a name="line50"></a> *   dragListGroup.setDraggerElClass(className3);
<a name="line51"></a> *   dragListGroup.addDragList(vertList, goog.fx.DragListDirection.DOWN);
<a name="line52"></a> *   dragListGroup.addDragList(horizList, goog.fx.DragListDirection.RIGHT);
<a name="line53"></a> *   dragListGroup.init();
<a name="line54"></a> *
<a name="line55"></a> * @extends {goog.events.EventTarget}
<a name="line56"></a> * @constructor
<a name="line57"></a> */
<a name="line58"></a>goog.fx.DragListGroup = function() {
<a name="line59"></a>  goog.events.EventTarget.call(this);
<a name="line60"></a>
<a name="line61"></a>  /**
<a name="line62"></a>   * The drag lists.
<a name="line63"></a>   * @type {Array.&lt;Element&gt;}
<a name="line64"></a>   * @private
<a name="line65"></a>   */
<a name="line66"></a>  this.dragLists_ = [];
<a name="line67"></a>
<a name="line68"></a>  /**
<a name="line69"></a>   * All the drag items. Set by init().
<a name="line70"></a>   * @type {Array.&lt;Element&gt;}
<a name="line71"></a>   * @private
<a name="line72"></a>   */
<a name="line73"></a>  this.dragItems_ = [];
<a name="line74"></a>
<a name="line75"></a>  /**
<a name="line76"></a>   * Which drag item corresponds to a given handle.  Set by init().
<a name="line77"></a>   * Specifically, this maps from the unique ID (as given by goog.getUid)
<a name="line78"></a>   * of the handle to the drag item.
<a name="line79"></a>   * @type {Object}
<a name="line80"></a>   * @private
<a name="line81"></a>   */
<a name="line82"></a>  this.dragItemForHandle_ = {};
<a name="line83"></a>
<a name="line84"></a>  /**
<a name="line85"></a>   * The event handler for this instance.
<a name="line86"></a>   * @type {goog.events.EventHandler}
<a name="line87"></a>   * @private
<a name="line88"></a>   */
<a name="line89"></a>  this.eventHandler_ = new goog.events.EventHandler(this);
<a name="line90"></a>
<a name="line91"></a>  /**
<a name="line92"></a>   * Whether the setup has been done to make all items in all lists draggable.
<a name="line93"></a>   * @type {boolean}
<a name="line94"></a>   * @private
<a name="line95"></a>   */
<a name="line96"></a>  this.isInitialized_ = false;
<a name="line97"></a>
<a name="line98"></a>  /**
<a name="line99"></a>   * Whether the currDragItem is always displayed. By default the list
<a name="line100"></a>   * collapses, the currDragItem&#39;s display is set to none, when we do not
<a name="line101"></a>   * hover over a draglist.
<a name="line102"></a>   * @type {boolean}
<a name="line103"></a>   * @private
<a name="line104"></a>   */
<a name="line105"></a>  this.isCurrDragItemAlwaysDisplayed_ = false;
<a name="line106"></a>
<a name="line107"></a>  /**
<a name="line108"></a>   * Whether to update the position of the currDragItem as we drag, i.e.,
<a name="line109"></a>   * insert the currDragItem each time to the position where it would land if
<a name="line110"></a>   * we were to end the drag at that point. Defaults to true.
<a name="line111"></a>   * @type {boolean}
<a name="line112"></a>   * @private
<a name="line113"></a>   */
<a name="line114"></a>  this.updateWhileDragging_ = true;
<a name="line115"></a>};
<a name="line116"></a>goog.inherits(goog.fx.DragListGroup, goog.events.EventTarget);
<a name="line117"></a>
<a name="line118"></a>
<a name="line119"></a>/**
<a name="line120"></a> * Enum to indicate the direction that a drag list grows.
<a name="line121"></a> * @enum {number}
<a name="line122"></a> */
<a name="line123"></a>goog.fx.DragListDirection = {
<a name="line124"></a>  DOWN: 0,  // common
<a name="line125"></a>  RIGHT: 2,  // common
<a name="line126"></a>  LEFT: 3,  // uncommon (except perhaps for right-to-left interfaces)
<a name="line127"></a>  RIGHT_2D: 4, // common + handles multiple lines if items are wrapped
<a name="line128"></a>  LEFT_2D: 5 // for rtl languages
<a name="line129"></a>};
<a name="line130"></a>
<a name="line131"></a>
<a name="line132"></a>/**
<a name="line133"></a> * Events dispatched by this class.
<a name="line134"></a> * @type {Object}
<a name="line135"></a> */
<a name="line136"></a>goog.fx.DragListGroup.EventType = {
<a name="line137"></a>  BEFOREDRAGSTART: &#39;beforedragstart&#39;,
<a name="line138"></a>  DRAGSTART: &#39;dragstart&#39;,
<a name="line139"></a>  BEFOREDRAGMOVE: &#39;beforedragmove&#39;,
<a name="line140"></a>  DRAGMOVE: &#39;dragmove&#39;,
<a name="line141"></a>  BEFOREDRAGEND: &#39;beforedragend&#39;,
<a name="line142"></a>  DRAGEND: &#39;dragend&#39;
<a name="line143"></a>};
<a name="line144"></a>
<a name="line145"></a>
<a name="line146"></a>// The next 4 are user-supplied CSS classes.
<a name="line147"></a>
<a name="line148"></a>
<a name="line149"></a>/**
<a name="line150"></a> * The user-supplied CSS classes to add to a drag item on hover (not during a
<a name="line151"></a> * drag action).
<a name="line152"></a> * @type {Array|undefined}
<a name="line153"></a> * @private
<a name="line154"></a> */
<a name="line155"></a>goog.fx.DragListGroup.prototype.dragItemHoverClasses_;
<a name="line156"></a>
<a name="line157"></a>
<a name="line158"></a>/**
<a name="line159"></a> * The user-supplied CSS classes to add to a drag item handle on hover (not
<a name="line160"></a> * during a drag action).
<a name="line161"></a> * @type {Array|undefined}
<a name="line162"></a> * @private
<a name="line163"></a> */
<a name="line164"></a>goog.fx.DragListGroup.prototype.dragItemHandleHoverClasses_;
<a name="line165"></a>
<a name="line166"></a>
<a name="line167"></a>/**
<a name="line168"></a> * The user-supplied CSS classes to add to the current drag item (during a drag
<a name="line169"></a> * action).
<a name="line170"></a> * @type {Array|undefined}
<a name="line171"></a> * @private
<a name="line172"></a> */
<a name="line173"></a>goog.fx.DragListGroup.prototype.currDragItemClasses_;
<a name="line174"></a>
<a name="line175"></a>
<a name="line176"></a>/**
<a name="line177"></a> * The user-supplied CSS class to add to the clone of the current drag item
<a name="line178"></a> * that&#39;s actually being dragged around (during a drag action).
<a name="line179"></a> * @type {string|undefined}
<a name="line180"></a> * @private
<a name="line181"></a> */
<a name="line182"></a>goog.fx.DragListGroup.prototype.draggerElClass_;
<a name="line183"></a>
<a name="line184"></a>
<a name="line185"></a>// The next 5 are info applicable during a drag action.
<a name="line186"></a>
<a name="line187"></a>
<a name="line188"></a>/**
<a name="line189"></a> * The current drag item being moved.
<a name="line190"></a> * Note: This is only defined while a drag action is happening.
<a name="line191"></a> * @type {Element}
<a name="line192"></a> * @private
<a name="line193"></a> */
<a name="line194"></a>goog.fx.DragListGroup.prototype.currDragItem_;
<a name="line195"></a>
<a name="line196"></a>
<a name="line197"></a>/**
<a name="line198"></a> * The drag list that {@code this.currDragItem_} is currently hovering over, or
<a name="line199"></a> * null if it is not hovering over a list.
<a name="line200"></a> * @type {Element}
<a name="line201"></a> * @private
<a name="line202"></a> */
<a name="line203"></a>goog.fx.DragListGroup.prototype.currHoverList_;
<a name="line204"></a>
<a name="line205"></a>
<a name="line206"></a>/**
<a name="line207"></a> * The original drag list that the current drag item came from. We need to
<a name="line208"></a> * remember this in case the user drops the item outside of any lists, in which
<a name="line209"></a> * case we return the item to its original location.
<a name="line210"></a> * Note: This is only defined while a drag action is happening.
<a name="line211"></a> * @type {Element}
<a name="line212"></a> * @private
<a name="line213"></a> */
<a name="line214"></a>goog.fx.DragListGroup.prototype.origList_;
<a name="line215"></a>
<a name="line216"></a>
<a name="line217"></a>/**
<a name="line218"></a> * The original next item in the original list that the current drag item came
<a name="line219"></a> * from. We need to remember this in case the user drops the item outside of
<a name="line220"></a> * any lists, in which case we return the item to its original location.
<a name="line221"></a> * Note: This is only defined while a drag action is happening.
<a name="line222"></a> * @type {Element}
<a name="line223"></a> * @private
<a name="line224"></a> */
<a name="line225"></a>goog.fx.DragListGroup.prototype.origNextItem_;
<a name="line226"></a>
<a name="line227"></a>
<a name="line228"></a>/**
<a name="line229"></a> * The current item in the list we are hovering over. We need to remember
<a name="line230"></a> * this in case we do not update the position of the current drag item while
<a name="line231"></a> * dragging (see {@code updateWhileDragging_}). In this case the current drag
<a name="line232"></a> * item will be inserted into the list before this element when the drag ends.
<a name="line233"></a> * @type {Element}
<a name="line234"></a> * @private
<a name="line235"></a> */
<a name="line236"></a>goog.fx.DragListGroup.prototype.currHoverItem_;
<a name="line237"></a>
<a name="line238"></a>
<a name="line239"></a>/**
<a name="line240"></a> * The clone of the current drag item that&#39;s actually being dragged around.
<a name="line241"></a> * Note: This is only defined while a drag action is happening.
<a name="line242"></a> * @type {Element}
<a name="line243"></a> * @private
<a name="line244"></a> */
<a name="line245"></a>goog.fx.DragListGroup.prototype.draggerEl_;
<a name="line246"></a>
<a name="line247"></a>
<a name="line248"></a>/**
<a name="line249"></a> * The dragger object.
<a name="line250"></a> * Note: This is only defined while a drag action is happening.
<a name="line251"></a> * @type {goog.fx.Dragger}
<a name="line252"></a> * @private
<a name="line253"></a> */
<a name="line254"></a>goog.fx.DragListGroup.prototype.dragger_;
<a name="line255"></a>
<a name="line256"></a>
<a name="line257"></a>/**
<a name="line258"></a> * The amount of distance, in pixels, after which a mousedown or touchstart is
<a name="line259"></a> * considered a drag.
<a name="line260"></a> * @type {number}
<a name="line261"></a> * @private
<a name="line262"></a> */
<a name="line263"></a>goog.fx.DragListGroup.prototype.hysteresisDistance_ = 0;
<a name="line264"></a>
<a name="line265"></a>
<a name="line266"></a>/**
<a name="line267"></a> * Sets the property of the currDragItem that it is always displayed in the
<a name="line268"></a> * list.
<a name="line269"></a> */
<a name="line270"></a>goog.fx.DragListGroup.prototype.setIsCurrDragItemAlwaysDisplayed = function() {
<a name="line271"></a>  this.isCurrDragItemAlwaysDisplayed_ = true;
<a name="line272"></a>};
<a name="line273"></a>
<a name="line274"></a>
<a name="line275"></a>/**
<a name="line276"></a> * Sets the private property updateWhileDragging_ to false. This disables the
<a name="line277"></a> * update of the position of the currDragItem while dragging. It will only be
<a name="line278"></a> * placed to its new location once the drag ends.
<a name="line279"></a> */
<a name="line280"></a>goog.fx.DragListGroup.prototype.setNoUpdateWhileDragging = function() {
<a name="line281"></a>  this.updateWhileDragging_ = false;
<a name="line282"></a>};
<a name="line283"></a>
<a name="line284"></a>
<a name="line285"></a>/**
<a name="line286"></a> * Sets the distance the user has to drag the element before a drag operation
<a name="line287"></a> * is started.
<a name="line288"></a> * @param {number} distance The number of pixels after which a mousedown and
<a name="line289"></a> *     move is considered a drag.
<a name="line290"></a> */
<a name="line291"></a>goog.fx.DragListGroup.prototype.setHysteresis = function(distance) {
<a name="line292"></a>  this.hysteresisDistance_ = distance;
<a name="line293"></a>};
<a name="line294"></a>
<a name="line295"></a>
<a name="line296"></a>/**
<a name="line297"></a> * @return {number} distance The number of pixels after which a mousedown and
<a name="line298"></a> *     move is considered a drag.
<a name="line299"></a> */
<a name="line300"></a>goog.fx.DragListGroup.prototype.getHysteresis = function() {
<a name="line301"></a>  return this.hysteresisDistance_;
<a name="line302"></a>};
<a name="line303"></a>
<a name="line304"></a>
<a name="line305"></a>/**
<a name="line306"></a> * Adds a drag list to this DragListGroup.
<a name="line307"></a> * All calls to this method must happen before the call to init().
<a name="line308"></a> * Remember that all child nodes (except text nodes) will be made draggable to
<a name="line309"></a> * any other drag list in this group.
<a name="line310"></a> *
<a name="line311"></a> * @param {Element} dragListElement Must be a container for a list of items
<a name="line312"></a> *     that should all be made draggable.
<a name="line313"></a> * @param {goog.fx.DragListDirection} growthDirection The direction that this
<a name="line314"></a> *     drag list grows in (i.e. if an item is appended to the DOM, the list&#39;s
<a name="line315"></a> *     bounding box expands in this direction).
<a name="line316"></a> * @param {boolean=} opt_unused Unused argument.
<a name="line317"></a> * @param {string=} opt_dragHoverClass CSS class to apply to this drag list when
<a name="line318"></a> *     the draggerEl hovers over it during a drag action.
<a name="line319"></a> */
<a name="line320"></a>goog.fx.DragListGroup.prototype.addDragList = function(
<a name="line321"></a>    dragListElement, growthDirection, opt_unused, opt_dragHoverClass) {
<a name="line322"></a>  goog.asserts.assert(!this.isInitialized_);
<a name="line323"></a>
<a name="line324"></a>  dragListElement.dlgGrowthDirection_ = growthDirection;
<a name="line325"></a>  dragListElement.dlgDragHoverClass_ = opt_dragHoverClass;
<a name="line326"></a>  this.dragLists_.push(dragListElement);
<a name="line327"></a>};
<a name="line328"></a>
<a name="line329"></a>
<a name="line330"></a>/**
<a name="line331"></a> * Sets a user-supplied function used to get the &quot;handle&quot; element for a drag
<a name="line332"></a> * item. The function must accept exactly one argument. The argument may be
<a name="line333"></a> * any drag item element.
<a name="line334"></a> *
<a name="line335"></a> * If not set, the default implementation uses the whole drag item as the
<a name="line336"></a> * handle.
<a name="line337"></a> *
<a name="line338"></a> * @param {function(Element): Element} getHandleForDragItemFn A function that,
<a name="line339"></a> *     given any drag item, returns a reference to its &quot;handle&quot; element
<a name="line340"></a> *     (which may be the drag item element itself).
<a name="line341"></a> */
<a name="line342"></a>goog.fx.DragListGroup.prototype.setFunctionToGetHandleForDragItem = function(
<a name="line343"></a>    getHandleForDragItemFn) {
<a name="line344"></a>  goog.asserts.assert(!this.isInitialized_);
<a name="line345"></a>  this.getHandleForDragItem_ = getHandleForDragItemFn;
<a name="line346"></a>};
<a name="line347"></a>
<a name="line348"></a>
<a name="line349"></a>/**
<a name="line350"></a> * Sets a user-supplied CSS class to add to a drag item on hover (not during a
<a name="line351"></a> * drag action).
<a name="line352"></a> * @param {...!string} var_args The CSS class or classes.
<a name="line353"></a> */
<a name="line354"></a>goog.fx.DragListGroup.prototype.setDragItemHoverClass = function(var_args) {
<a name="line355"></a>  goog.asserts.assert(!this.isInitialized_);
<a name="line356"></a>  this.dragItemHoverClasses_ = goog.array.slice(arguments, 0);
<a name="line357"></a>};
<a name="line358"></a>
<a name="line359"></a>
<a name="line360"></a>/**
<a name="line361"></a> * Sets a user-supplied CSS class to add to a drag item handle on hover (not
<a name="line362"></a> * during a drag action).
<a name="line363"></a> * @param {...!string} var_args The CSS class or classes.
<a name="line364"></a> */
<a name="line365"></a>goog.fx.DragListGroup.prototype.setDragItemHandleHoverClass = function(
<a name="line366"></a>    var_args) {
<a name="line367"></a>  goog.asserts.assert(!this.isInitialized_);
<a name="line368"></a>  this.dragItemHandleHoverClasses_ = goog.array.slice(arguments, 0);
<a name="line369"></a>};
<a name="line370"></a>
<a name="line371"></a>
<a name="line372"></a>/**
<a name="line373"></a> * Sets a user-supplied CSS class to add to the current drag item (during a
<a name="line374"></a> * drag action).
<a name="line375"></a> *
<a name="line376"></a> * If not set, the default behavior adds visibility:hidden to the current drag
<a name="line377"></a> * item so that it is a block of empty space in the hover drag list (if any).
<a name="line378"></a> * If this class is set by the user, then the default behavior does not happen
<a name="line379"></a> * (unless, of course, the class also contains visibility:hidden).
<a name="line380"></a> *
<a name="line381"></a> * @param {...!string} var_args The CSS class or classes.
<a name="line382"></a> */
<a name="line383"></a>goog.fx.DragListGroup.prototype.setCurrDragItemClass = function(var_args) {
<a name="line384"></a>  goog.asserts.assert(!this.isInitialized_);
<a name="line385"></a>  this.currDragItemClasses_ = goog.array.slice(arguments, 0);
<a name="line386"></a>};
<a name="line387"></a>
<a name="line388"></a>
<a name="line389"></a>/**
<a name="line390"></a> * Sets a user-supplied CSS class to add to the clone of the current drag item
<a name="line391"></a> * that&#39;s actually being dragged around (during a drag action).
<a name="line392"></a> * @param {string} draggerElClass The CSS class.
<a name="line393"></a> */
<a name="line394"></a>goog.fx.DragListGroup.prototype.setDraggerElClass = function(draggerElClass) {
<a name="line395"></a>  goog.asserts.assert(!this.isInitialized_);
<a name="line396"></a>  this.draggerElClass_ = draggerElClass;
<a name="line397"></a>};
<a name="line398"></a>
<a name="line399"></a>
<a name="line400"></a>/**
<a name="line401"></a> * Performs the initial setup to make all items in all lists draggable.
<a name="line402"></a> */
<a name="line403"></a>goog.fx.DragListGroup.prototype.init = function() {
<a name="line404"></a>  if (this.isInitialized_) {
<a name="line405"></a>    return;
<a name="line406"></a>  }
<a name="line407"></a>
<a name="line408"></a>  for (var i = 0, numLists = this.dragLists_.length; i &lt; numLists; i++) {
<a name="line409"></a>    var dragList = this.dragLists_[i];
<a name="line410"></a>
<a name="line411"></a>    var dragItems = goog.dom.getChildren(dragList);
<a name="line412"></a>    for (var j = 0, numItems = dragItems.length; j &lt; numItems; ++j) {
<a name="line413"></a>      var dragItem = dragItems[j];
<a name="line414"></a>      var dragItemHandle = this.getHandleForDragItem_(dragItem);
<a name="line415"></a>
<a name="line416"></a>      var uid = goog.getUid(dragItemHandle);
<a name="line417"></a>      this.dragItemForHandle_[uid] = dragItem;
<a name="line418"></a>
<a name="line419"></a>      if (this.dragItemHoverClasses_) {
<a name="line420"></a>        this.eventHandler_.listen(
<a name="line421"></a>            dragItem, goog.events.EventType.MOUSEOVER,
<a name="line422"></a>            this.handleDragItemMouseover_);
<a name="line423"></a>        this.eventHandler_.listen(
<a name="line424"></a>            dragItem, goog.events.EventType.MOUSEOUT,
<a name="line425"></a>            this.handleDragItemMouseout_);
<a name="line426"></a>      }
<a name="line427"></a>      if (this.dragItemHandleHoverClasses_) {
<a name="line428"></a>        this.eventHandler_.listen(
<a name="line429"></a>            dragItemHandle, goog.events.EventType.MOUSEOVER,
<a name="line430"></a>            this.handleDragItemHandleMouseover_);
<a name="line431"></a>        this.eventHandler_.listen(
<a name="line432"></a>            dragItemHandle, goog.events.EventType.MOUSEOUT,
<a name="line433"></a>            this.handleDragItemHandleMouseout_);
<a name="line434"></a>      }
<a name="line435"></a>
<a name="line436"></a>      this.dragItems_.push(dragItem);
<a name="line437"></a>      this.eventHandler_.listen(dragItemHandle,
<a name="line438"></a>          [goog.events.EventType.MOUSEDOWN, goog.events.EventType.TOUCHSTART],
<a name="line439"></a>          this.handlePotentialDragStart_);
<a name="line440"></a>    }
<a name="line441"></a>  }
<a name="line442"></a>
<a name="line443"></a>  this.isInitialized_ = true;
<a name="line444"></a>};
<a name="line445"></a>
<a name="line446"></a>
<a name="line447"></a>/** @override */
<a name="line448"></a>goog.fx.DragListGroup.prototype.disposeInternal = function() {
<a name="line449"></a>  this.eventHandler_.dispose();
<a name="line450"></a>
<a name="line451"></a>  for (var i = 0, n = this.dragLists_.length; i &lt; n; i++) {
<a name="line452"></a>    var dragList = this.dragLists_[i];
<a name="line453"></a>    // Note: IE doesn&#39;t allow &#39;delete&#39; for fields on HTML elements (because
<a name="line454"></a>    // they&#39;re not real JS objects in IE), so we just set them to undefined.
<a name="line455"></a>    dragList.dlgGrowthDirection_ = undefined;
<a name="line456"></a>    dragList.dlgDragHoverClass_ = undefined;
<a name="line457"></a>  }
<a name="line458"></a>
<a name="line459"></a>  this.dragLists_.length = 0;
<a name="line460"></a>  this.dragItems_.length = 0;
<a name="line461"></a>  this.dragItemForHandle_ = null;
<a name="line462"></a>
<a name="line463"></a>  // In the case where a drag event is currently in-progress and dispose is
<a name="line464"></a>  // called, this cleans up the extra state.
<a name="line465"></a>  this.cleanupDragDom_();
<a name="line466"></a>
<a name="line467"></a>  goog.fx.DragListGroup.superClass_.disposeInternal.call(this);
<a name="line468"></a>};
<a name="line469"></a>
<a name="line470"></a>
<a name="line471"></a>/**
<a name="line472"></a> * Caches the heights of each drag list and drag item, except for the current
<a name="line473"></a> * drag item.
<a name="line474"></a> *
<a name="line475"></a> * @param {Element} currDragItem The item currently being dragged.
<a name="line476"></a> * @private
<a name="line477"></a> */
<a name="line478"></a>goog.fx.DragListGroup.prototype.recacheListAndItemBounds_ = function(
<a name="line479"></a>    currDragItem) {
<a name="line480"></a>  for (var i = 0, n = this.dragLists_.length; i &lt; n; i++) {
<a name="line481"></a>    var dragList = this.dragLists_[i];
<a name="line482"></a>    dragList.dlgBounds_ = goog.style.getBounds(dragList);
<a name="line483"></a>  }
<a name="line484"></a>
<a name="line485"></a>  for (var i = 0, n = this.dragItems_.length; i &lt; n; i++) {
<a name="line486"></a>    var dragItem = this.dragItems_[i];
<a name="line487"></a>    if (dragItem != currDragItem) {
<a name="line488"></a>      dragItem.dlgBounds_ = goog.style.getBounds(dragItem);
<a name="line489"></a>    }
<a name="line490"></a>  }
<a name="line491"></a>};
<a name="line492"></a>
<a name="line493"></a>
<a name="line494"></a>/**
<a name="line495"></a> * Handles mouse and touch events which may start a drag action.
<a name="line496"></a> * @param {!goog.events.BrowserEvent} e MOUSEDOWN or TOUCHSTART event.
<a name="line497"></a> * @private
<a name="line498"></a> */
<a name="line499"></a>goog.fx.DragListGroup.prototype.handlePotentialDragStart_ = function(e) {
<a name="line500"></a>  var uid = goog.getUid(/** @type {Node} */ (e.currentTarget));
<a name="line501"></a>  this.currDragItem_ = /** @type {Element} */ (this.dragItemForHandle_[uid]);
<a name="line502"></a>
<a name="line503"></a>  this.draggerEl_ = this.cloneNode_(this.currDragItem_);
<a name="line504"></a>  if (this.draggerElClass_) {
<a name="line505"></a>    // Add CSS class for the clone, if any.
<a name="line506"></a>    goog.dom.classes.add(this.draggerEl_, this.draggerElClass_);
<a name="line507"></a>  }
<a name="line508"></a>
<a name="line509"></a>  // Place the clone (i.e. draggerEl) at the same position as the actual
<a name="line510"></a>  // current drag item. This is a bit tricky since
<a name="line511"></a>  //   goog.style.getPageOffset() gets the left-top pos of the border, but
<a name="line512"></a>  //   goog.style.setPageOffset() sets the left-top pos of the margin.
<a name="line513"></a>  // It&#39;s difficult to adjust for the margins of the clone because it&#39;s
<a name="line514"></a>  // difficult to read it: goog.style.getComputedStyle() doesn&#39;t work for IE.
<a name="line515"></a>  // Instead, our workaround is simply to set the clone&#39;s margins to 0px.
<a name="line516"></a>  this.draggerEl_.style.margin = &#39;0&#39;;
<a name="line517"></a>  this.draggerEl_.style.position = &#39;absolute&#39;;
<a name="line518"></a>  this.draggerEl_.style.visibility = &#39;hidden&#39;;
<a name="line519"></a>  var doc = goog.dom.getOwnerDocument(this.currDragItem_);
<a name="line520"></a>  doc.body.appendChild(this.draggerEl_);
<a name="line521"></a>
<a name="line522"></a>  // Important: goog.style.setPageOffset() only works correctly for IE when the
<a name="line523"></a>  // element is already in the document.
<a name="line524"></a>  var currDragItemPos = goog.style.getPageOffset(this.currDragItem_);
<a name="line525"></a>  goog.style.setPageOffset(this.draggerEl_, currDragItemPos);
<a name="line526"></a>
<a name="line527"></a>  this.dragger_ = new goog.fx.Dragger(this.draggerEl_);
<a name="line528"></a>  this.dragger_.setHysteresis(this.hysteresisDistance_);
<a name="line529"></a>
<a name="line530"></a>  // Listen to events on the dragger. These handlers will be unregistered at
<a name="line531"></a>  // DRAGEND, when the dragger is disposed of. We can&#39;t use eventHandler_,
<a name="line532"></a>  // because it creates new references to the handler functions at each
<a name="line533"></a>  // dragging action, and keeps them until DragListGroup is disposed of.
<a name="line534"></a>  goog.events.listen(this.dragger_, goog.fx.Dragger.EventType.START,
<a name="line535"></a>      this.handleDragStart_, false, this);
<a name="line536"></a>  goog.events.listen(this.dragger_, goog.fx.Dragger.EventType.END,
<a name="line537"></a>      this.handleDragEnd_, false, this);
<a name="line538"></a>  goog.events.listen(this.dragger_, goog.fx.Dragger.EventType.EARLY_CANCEL,
<a name="line539"></a>      this.cleanup_, false, this);
<a name="line540"></a>  this.dragger_.startDrag(e);
<a name="line541"></a>};
<a name="line542"></a>
<a name="line543"></a>
<a name="line544"></a>/**
<a name="line545"></a> * Handles the start of a drag action.
<a name="line546"></a> * @param {!goog.fx.DragEvent} e goog.fx.Dragger.EventType.START event.
<a name="line547"></a> * @private
<a name="line548"></a> */
<a name="line549"></a>goog.fx.DragListGroup.prototype.handleDragStart_ = function(e) {
<a name="line550"></a>  if (!this.dispatchEvent(new goog.fx.DragListGroupEvent(
<a name="line551"></a>      goog.fx.DragListGroup.EventType.BEFOREDRAGSTART, this, e.browserEvent,
<a name="line552"></a>      this.currDragItem_, null, null))) {
<a name="line553"></a>    e.preventDefault();
<a name="line554"></a>    this.cleanup_();
<a name="line555"></a>    return;
<a name="line556"></a>  }
<a name="line557"></a>
<a name="line558"></a>  // Record the original location of the current drag item.
<a name="line559"></a>  // Note: this.origNextItem_ may be null.
<a name="line560"></a>  this.origList_ = /** @type {Element} */ (this.currDragItem_.parentNode);
<a name="line561"></a>  this.origNextItem_ = goog.dom.getNextElementSibling(this.currDragItem_);
<a name="line562"></a>  this.currHoverItem_ = this.origNextItem_;
<a name="line563"></a>  this.currHoverList_ = this.origList_;
<a name="line564"></a>
<a name="line565"></a>  // If there&#39;s a CSS class specified for the current drag item, add it.
<a name="line566"></a>  // Otherwise, make the actual current drag item hidden (takes up space).
<a name="line567"></a>  if (this.currDragItemClasses_) {
<a name="line568"></a>    goog.dom.classes.add.apply(null,
<a name="line569"></a>        goog.array.concat(this.currDragItem_, this.currDragItemClasses_));
<a name="line570"></a>  } else {
<a name="line571"></a>    this.currDragItem_.style.visibility = &#39;hidden&#39;;
<a name="line572"></a>  }
<a name="line573"></a>
<a name="line574"></a>  // Precompute distances from top-left corner to center for efficiency.
<a name="line575"></a>  var draggerElSize = goog.style.getSize(this.draggerEl_);
<a name="line576"></a>  this.draggerEl_.halfWidth = draggerElSize.width / 2;
<a name="line577"></a>  this.draggerEl_.halfHeight = draggerElSize.height / 2;
<a name="line578"></a>
<a name="line579"></a>  this.draggerEl_.style.visibility = &#39;&#39;;
<a name="line580"></a>
<a name="line581"></a>  // Record the bounds of all the drag lists and all the other drag items. This
<a name="line582"></a>  // caching is for efficiency, so that we don&#39;t have to recompute the bounds on
<a name="line583"></a>  // each drag move. Do this in the state where the current drag item is not in
<a name="line584"></a>  // any of the lists, except when update while dragging is disabled, as in this
<a name="line585"></a>  // case the current drag item does not get removed until drag ends.
<a name="line586"></a>  if (this.updateWhileDragging_) {
<a name="line587"></a>    this.currDragItem_.style.display = &#39;none&#39;;
<a name="line588"></a>  }
<a name="line589"></a>  this.recacheListAndItemBounds_(this.currDragItem_);
<a name="line590"></a>  this.currDragItem_.style.display = &#39;&#39;;
<a name="line591"></a>
<a name="line592"></a>  // Listen to events on the dragger.
<a name="line593"></a>  goog.events.listen(this.dragger_, goog.fx.Dragger.EventType.DRAG,
<a name="line594"></a>      this.handleDragMove_, false, this);
<a name="line595"></a>
<a name="line596"></a>  this.dispatchEvent(
<a name="line597"></a>      new goog.fx.DragListGroupEvent(
<a name="line598"></a>          goog.fx.DragListGroup.EventType.DRAGSTART, this, e.browserEvent,
<a name="line599"></a>          this.currDragItem_, this.draggerEl_, this.dragger_));
<a name="line600"></a>};
<a name="line601"></a>
<a name="line602"></a>
<a name="line603"></a>/**
<a name="line604"></a> * Handles a drag movement (i.e. DRAG event fired by the dragger).
<a name="line605"></a> *
<a name="line606"></a> * @param {goog.fx.DragEvent} dragEvent Event object fired by the dragger.
<a name="line607"></a> * @return {boolean} The return value for the event.
<a name="line608"></a> * @private
<a name="line609"></a> */
<a name="line610"></a>goog.fx.DragListGroup.prototype.handleDragMove_ = function(dragEvent) {
<a name="line611"></a>
<a name="line612"></a>  // Compute the center of the dragger element (i.e. the cloned drag item).
<a name="line613"></a>  var draggerElPos = goog.style.getPageOffset(this.draggerEl_);
<a name="line614"></a>  var draggerElCenter = new goog.math.Coordinate(
<a name="line615"></a>      draggerElPos.x + this.draggerEl_.halfWidth,
<a name="line616"></a>      draggerElPos.y + this.draggerEl_.halfHeight);
<a name="line617"></a>
<a name="line618"></a>  // Check whether the center is hovering over one of the drag lists.
<a name="line619"></a>  var hoverList = this.getHoverDragList_(draggerElCenter);
<a name="line620"></a>
<a name="line621"></a>  // If hovering over a list, find the next item (if drag were to end now).
<a name="line622"></a>  var hoverNextItem =
<a name="line623"></a>      hoverList ? this.getHoverNextItem_(hoverList, draggerElCenter) : null;
<a name="line624"></a>
<a name="line625"></a>  var rv = this.dispatchEvent(
<a name="line626"></a>      new goog.fx.DragListGroupEvent(
<a name="line627"></a>          goog.fx.DragListGroup.EventType.BEFOREDRAGMOVE, this, dragEvent,
<a name="line628"></a>          this.currDragItem_, this.draggerEl_, this.dragger_,
<a name="line629"></a>          draggerElCenter, hoverList, hoverNextItem));
<a name="line630"></a>  if (!rv) {
<a name="line631"></a>    return false;
<a name="line632"></a>  }
<a name="line633"></a>
<a name="line634"></a>  if (hoverList) {
<a name="line635"></a>    if (this.updateWhileDragging_) {
<a name="line636"></a>      this.insertCurrDragItem_(hoverList, hoverNextItem);
<a name="line637"></a>    } else {
<a name="line638"></a>      // If update while dragging is disabled do not insert
<a name="line639"></a>      // the dragged item, but update the hovered item instead.
<a name="line640"></a>      this.updateCurrHoverItem(hoverNextItem, draggerElCenter);
<a name="line641"></a>    }
<a name="line642"></a>    this.currDragItem_.style.display = &#39;&#39;;
<a name="line643"></a>    // Add drag list&#39;s hover class (if any).
<a name="line644"></a>    if (hoverList.dlgDragHoverClass_) {
<a name="line645"></a>      goog.dom.classes.add(hoverList, hoverList.dlgDragHoverClass_);
<a name="line646"></a>    }
<a name="line647"></a>
<a name="line648"></a>  } else {
<a name="line649"></a>    // Not hovering over a drag list, so remove the item altogether unless
<a name="line650"></a>    // specified otherwise by the user.
<a name="line651"></a>    if (!this.isCurrDragItemAlwaysDisplayed_) {
<a name="line652"></a>      this.currDragItem_.style.display = &#39;none&#39;;
<a name="line653"></a>    }
<a name="line654"></a>
<a name="line655"></a>    // Remove hover classes (if any) from all drag lists.
<a name="line656"></a>    for (var i = 0, n = this.dragLists_.length; i &lt; n; i++) {
<a name="line657"></a>      var dragList = this.dragLists_[i];
<a name="line658"></a>      if (dragList.dlgDragHoverClass_) {
<a name="line659"></a>        goog.dom.classes.remove(dragList, dragList.dlgDragHoverClass_);
<a name="line660"></a>      }
<a name="line661"></a>    }
<a name="line662"></a>  }
<a name="line663"></a>
<a name="line664"></a>  // If the current hover list is different than the last, the lists may have
<a name="line665"></a>  // shrunk, so we should recache the bounds.
<a name="line666"></a>  if (hoverList != this.currHoverList_) {
<a name="line667"></a>    this.currHoverList_ = hoverList;
<a name="line668"></a>    this.recacheListAndItemBounds_(this.currDragItem_);
<a name="line669"></a>  }
<a name="line670"></a>
<a name="line671"></a>  this.dispatchEvent(
<a name="line672"></a>      new goog.fx.DragListGroupEvent(
<a name="line673"></a>          goog.fx.DragListGroup.EventType.DRAGMOVE, this, dragEvent,
<a name="line674"></a>          /** @type {Element} */ (this.currDragItem_),
<a name="line675"></a>          this.draggerEl_, this.dragger_,
<a name="line676"></a>          draggerElCenter, hoverList, hoverNextItem));
<a name="line677"></a>
<a name="line678"></a>  // Return false to prevent selection due to mouse drag.
<a name="line679"></a>  return false;
<a name="line680"></a>};
<a name="line681"></a>
<a name="line682"></a>
<a name="line683"></a>/**
<a name="line684"></a> * Clear all our temporary fields that are only defined while dragging, and
<a name="line685"></a> * all the bounds info stored on the drag lists and drag elements.
<a name="line686"></a> * @param {!goog.events.Event=} opt_e EARLY_CANCEL event from the dragger if
<a name="line687"></a> *     cleanup_ was called as an event handler.
<a name="line688"></a> * @private
<a name="line689"></a> */
<a name="line690"></a>goog.fx.DragListGroup.prototype.cleanup_ = function(opt_e) {
<a name="line691"></a>  this.cleanupDragDom_();
<a name="line692"></a>
<a name="line693"></a>  this.currDragItem_ = null;
<a name="line694"></a>  this.currHoverList_ = null;
<a name="line695"></a>  this.origList_ = null;
<a name="line696"></a>  this.origNextItem_ = null;
<a name="line697"></a>  this.draggerEl_ = null;
<a name="line698"></a>  this.dragger_ = null;
<a name="line699"></a>
<a name="line700"></a>  // Note: IE doesn&#39;t allow &#39;delete&#39; for fields on HTML elements (because
<a name="line701"></a>  // they&#39;re not real JS objects in IE), so we just set them to null.
<a name="line702"></a>  for (var i = 0, n = this.dragLists_.length; i &lt; n; i++) {
<a name="line703"></a>    this.dragLists_[i].dlgBounds_ = null;
<a name="line704"></a>  }
<a name="line705"></a>  for (var i = 0, n = this.dragItems_.length; i &lt; n; i++) {
<a name="line706"></a>    this.dragItems_[i].dlgBounds_ = null;
<a name="line707"></a>  }
<a name="line708"></a>};
<a name="line709"></a>
<a name="line710"></a>
<a name="line711"></a>/**
<a name="line712"></a> * Handles the end or the cancellation of a drag action, i.e. END or CLEANUP
<a name="line713"></a> * event fired by the dragger.
<a name="line714"></a> *
<a name="line715"></a> * @param {!goog.fx.DragEvent} dragEvent Event object fired by the dragger.
<a name="line716"></a> * @return {boolean} Whether the event was handled.
<a name="line717"></a> * @private
<a name="line718"></a> */
<a name="line719"></a>goog.fx.DragListGroup.prototype.handleDragEnd_ = function(dragEvent) {
<a name="line720"></a>  var rv = this.dispatchEvent(
<a name="line721"></a>      new goog.fx.DragListGroupEvent(
<a name="line722"></a>          goog.fx.DragListGroup.EventType.BEFOREDRAGEND, this, dragEvent,
<a name="line723"></a>          /** @type {Element} */ (this.currDragItem_),
<a name="line724"></a>          this.draggerEl_, this.dragger_));
<a name="line725"></a>  if (!rv) {
<a name="line726"></a>    return false;
<a name="line727"></a>  }
<a name="line728"></a>
<a name="line729"></a>  // If update while dragging is disabled insert the current drag item into
<a name="line730"></a>  // its intended location.
<a name="line731"></a>  if (!this.updateWhileDragging_) {
<a name="line732"></a>    this.insertCurrHoverItem();
<a name="line733"></a>  }
<a name="line734"></a>
<a name="line735"></a>  // The DRAGEND handler may need the new order of the list items. Clean up the
<a name="line736"></a>  // garbage.
<a name="line737"></a>  // TODO(user): Regression test.
<a name="line738"></a>  this.cleanupDragDom_();
<a name="line739"></a>
<a name="line740"></a>  this.dispatchEvent(
<a name="line741"></a>      new goog.fx.DragListGroupEvent(
<a name="line742"></a>          goog.fx.DragListGroup.EventType.DRAGEND, this, dragEvent,
<a name="line743"></a>          this.currDragItem_, this.draggerEl_, this.dragger_));
<a name="line744"></a>
<a name="line745"></a>  this.cleanup_();
<a name="line746"></a>
<a name="line747"></a>  return true;
<a name="line748"></a>};
<a name="line749"></a>
<a name="line750"></a>
<a name="line751"></a>/**
<a name="line752"></a> * Cleans up DOM changes that are made by the {@code handleDrag*} methods.
<a name="line753"></a> * @private
<a name="line754"></a> */
<a name="line755"></a>goog.fx.DragListGroup.prototype.cleanupDragDom_ = function() {
<a name="line756"></a>  // Disposes of the dragger and remove the cloned drag item.
<a name="line757"></a>  goog.dispose(this.dragger_);
<a name="line758"></a>  if (this.draggerEl_) {
<a name="line759"></a>    goog.dom.removeNode(this.draggerEl_);
<a name="line760"></a>  }
<a name="line761"></a>
<a name="line762"></a>  // If the current drag item is not in any list, put it back in its original
<a name="line763"></a>  // location.
<a name="line764"></a>  if (this.currDragItem_ &amp;&amp; this.currDragItem_.style.display == &#39;none&#39;) {
<a name="line765"></a>    // Note: this.origNextItem_ may be null, but insertBefore() still works.
<a name="line766"></a>    this.origList_.insertBefore(this.currDragItem_, this.origNextItem_);
<a name="line767"></a>    this.currDragItem_.style.display = &#39;&#39;;
<a name="line768"></a>  }
<a name="line769"></a>
<a name="line770"></a>  // If there&#39;s a CSS class specified for the current drag item, remove it.
<a name="line771"></a>  // Otherwise, make the current drag item visible (instead of empty space).
<a name="line772"></a>  if (this.currDragItemClasses_ &amp;&amp; this.currDragItem_) {
<a name="line773"></a>    goog.dom.classes.remove.apply(null,
<a name="line774"></a>        goog.array.concat(this.currDragItem_, this.currDragItemClasses_));
<a name="line775"></a>  } else if (this.currDragItem_) {
<a name="line776"></a>    this.currDragItem_.style.visibility = &#39;visible&#39;;
<a name="line777"></a>  }
<a name="line778"></a>
<a name="line779"></a>  // Remove hover classes (if any) from all drag lists.
<a name="line780"></a>  for (var i = 0, n = this.dragLists_.length; i &lt; n; i++) {
<a name="line781"></a>    var dragList = this.dragLists_[i];
<a name="line782"></a>    if (dragList.dlgDragHoverClass_) {
<a name="line783"></a>      goog.dom.classes.remove(dragList, dragList.dlgDragHoverClass_);
<a name="line784"></a>    }
<a name="line785"></a>  }
<a name="line786"></a>};
<a name="line787"></a>
<a name="line788"></a>
<a name="line789"></a>/**
<a name="line790"></a> * Default implementation of the function to get the &quot;handle&quot; element for a
<a name="line791"></a> * drag item. By default, we use the whole drag item as the handle. Users can
<a name="line792"></a> * change this by calling setFunctionToGetHandleForDragItem().
<a name="line793"></a> *
<a name="line794"></a> * @param {Element} dragItem The drag item to get the handle for.
<a name="line795"></a> * @return {Element} The dragItem element itself.
<a name="line796"></a> * @private
<a name="line797"></a> */
<a name="line798"></a>goog.fx.DragListGroup.prototype.getHandleForDragItem_ = function(dragItem) {
<a name="line799"></a>  return dragItem;
<a name="line800"></a>};
<a name="line801"></a>
<a name="line802"></a>
<a name="line803"></a>/**
<a name="line804"></a> * Handles a MOUSEOVER event fired on a drag item.
<a name="line805"></a> * @param {goog.events.BrowserEvent} e The event.
<a name="line806"></a> * @private
<a name="line807"></a> */
<a name="line808"></a>goog.fx.DragListGroup.prototype.handleDragItemMouseover_ = function(e) {
<a name="line809"></a>  goog.dom.classes.add.apply(null,
<a name="line810"></a>      goog.array.concat(/** @type {Element} */ (e.currentTarget),
<a name="line811"></a>                        this.dragItemHoverClasses_));
<a name="line812"></a>};
<a name="line813"></a>
<a name="line814"></a>
<a name="line815"></a>/**
<a name="line816"></a> * Handles a MOUSEOUT event fired on a drag item.
<a name="line817"></a> * @param {goog.events.BrowserEvent} e The event.
<a name="line818"></a> * @private
<a name="line819"></a> */
<a name="line820"></a>goog.fx.DragListGroup.prototype.handleDragItemMouseout_ = function(e) {
<a name="line821"></a>  goog.dom.classes.remove.apply(null,
<a name="line822"></a>      goog.array.concat(/** @type {Element} */ (e.currentTarget),
<a name="line823"></a>                        this.dragItemHoverClasses_));
<a name="line824"></a>};
<a name="line825"></a>
<a name="line826"></a>
<a name="line827"></a>/**
<a name="line828"></a> * Handles a MOUSEOVER event fired on the handle element of a drag item.
<a name="line829"></a> * @param {goog.events.BrowserEvent} e The event.
<a name="line830"></a> * @private
<a name="line831"></a> */
<a name="line832"></a>goog.fx.DragListGroup.prototype.handleDragItemHandleMouseover_ = function(e) {
<a name="line833"></a>  goog.dom.classes.add.apply(null,
<a name="line834"></a>      goog.array.concat(/** @type {Element} */ (e.currentTarget),
<a name="line835"></a>                        this.dragItemHandleHoverClasses_));
<a name="line836"></a>};
<a name="line837"></a>
<a name="line838"></a>
<a name="line839"></a>/**
<a name="line840"></a> * Handles a MOUSEOUT event fired on the handle element of a drag item.
<a name="line841"></a> * @param {goog.events.BrowserEvent} e The event.
<a name="line842"></a> * @private
<a name="line843"></a> */
<a name="line844"></a>goog.fx.DragListGroup.prototype.handleDragItemHandleMouseout_ = function(e) {
<a name="line845"></a>  goog.dom.classes.remove.apply(null,
<a name="line846"></a>      goog.array.concat(/** @type {Element} */ (e.currentTarget),
<a name="line847"></a>                        this.dragItemHandleHoverClasses_));
<a name="line848"></a>};
<a name="line849"></a>
<a name="line850"></a>
<a name="line851"></a>/**
<a name="line852"></a> * Helper for handleDragMove_().
<a name="line853"></a> * Given the position of the center of the dragger element, figures out whether
<a name="line854"></a> * it&#39;s currently hovering over any of the drag lists.
<a name="line855"></a> *
<a name="line856"></a> * @param {goog.math.Coordinate} draggerElCenter The center position of the
<a name="line857"></a> *     dragger element.
<a name="line858"></a> * @return {Element} If currently hovering over a drag list, returns the drag
<a name="line859"></a> *     list element. Else returns null.
<a name="line860"></a> * @private
<a name="line861"></a> */
<a name="line862"></a>goog.fx.DragListGroup.prototype.getHoverDragList_ = function(draggerElCenter) {
<a name="line863"></a>
<a name="line864"></a>  // If the current drag item was in a list last time we did this, then check
<a name="line865"></a>  // that same list first.
<a name="line866"></a>  var prevHoverList = null;
<a name="line867"></a>  if (this.currDragItem_.style.display != &#39;none&#39;) {
<a name="line868"></a>    prevHoverList = /** @type {Element} */ (this.currDragItem_.parentNode);
<a name="line869"></a>    // Important: We can&#39;t use the cached bounds for this list because the
<a name="line870"></a>    // cached bounds are based on the case where the current drag item is not
<a name="line871"></a>    // in the list. Since the current drag item is known to be in this list, we
<a name="line872"></a>    // must recompute the list&#39;s bounds.
<a name="line873"></a>    var prevHoverListBounds = goog.style.getBounds(prevHoverList);
<a name="line874"></a>    if (this.isInRect_(draggerElCenter, prevHoverListBounds)) {
<a name="line875"></a>      return prevHoverList;
<a name="line876"></a>    }
<a name="line877"></a>  }
<a name="line878"></a>
<a name="line879"></a>  for (var i = 0, n = this.dragLists_.length; i &lt; n; i++) {
<a name="line880"></a>    var dragList = this.dragLists_[i];
<a name="line881"></a>    if (dragList == prevHoverList) {
<a name="line882"></a>      continue;
<a name="line883"></a>    }
<a name="line884"></a>    if (this.isInRect_(draggerElCenter, dragList.dlgBounds_)) {
<a name="line885"></a>      return dragList;
<a name="line886"></a>    }
<a name="line887"></a>  }
<a name="line888"></a>
<a name="line889"></a>  return null;
<a name="line890"></a>};
<a name="line891"></a>
<a name="line892"></a>
<a name="line893"></a>/**
<a name="line894"></a> * Checks whether a coordinate position resides inside a rectangle.
<a name="line895"></a> * @param {goog.math.Coordinate} pos The coordinate position.
<a name="line896"></a> * @param {goog.math.Rect} rect The rectangle.
<a name="line897"></a> * @return {boolean} True if &#39;pos&#39; is within the bounds of &#39;rect&#39;.
<a name="line898"></a> * @private
<a name="line899"></a> */
<a name="line900"></a>goog.fx.DragListGroup.prototype.isInRect_ = function(pos, rect) {
<a name="line901"></a>  return pos.x &gt; rect.left &amp;&amp; pos.x &lt; rect.left + rect.width &amp;&amp;
<a name="line902"></a>         pos.y &gt; rect.top &amp;&amp; pos.y &lt; rect.top + rect.height;
<a name="line903"></a>};
<a name="line904"></a>
<a name="line905"></a>
<a name="line906"></a>/**
<a name="line907"></a> * Updates the value of currHoverItem_.
<a name="line908"></a> *
<a name="line909"></a> * This method is used for insertion only when updateWhileDragging_ is false.
<a name="line910"></a> * The below implementation is the basic one. This method can be extended by
<a name="line911"></a> * a subclass to support changes to hovered item (eg: highlighting). Parametr
<a name="line912"></a> * opt_draggerElCenter can be used for more sophisticated effects.
<a name="line913"></a> *
<a name="line914"></a> * @param {Element} hoverNextItem element of the list that is hovered over.
<a name="line915"></a> * @param {goog.math.Coordinate=} opt_draggerElCenter current position of
<a name="line916"></a> *     the dragged element.
<a name="line917"></a> * @protected
<a name="line918"></a> */
<a name="line919"></a>goog.fx.DragListGroup.prototype.updateCurrHoverItem = function(
<a name="line920"></a>    hoverNextItem, opt_draggerElCenter) {
<a name="line921"></a>  if (hoverNextItem) {
<a name="line922"></a>    this.currHoverItem_ = hoverNextItem;
<a name="line923"></a>  }
<a name="line924"></a>};
<a name="line925"></a>
<a name="line926"></a>
<a name="line927"></a>/**
<a name="line928"></a> * Inserts the currently dragged item in its new place.
<a name="line929"></a> *
<a name="line930"></a> * This method is used for insertion only when updateWhileDragging_ is false
<a name="line931"></a> * (otherwise there is no need for that). In the basic implementation
<a name="line932"></a> * the element is inserted before the currently hovered over item (this can
<a name="line933"></a> * be changed by overriding the method in subclasses).
<a name="line934"></a> *
<a name="line935"></a> * @protected
<a name="line936"></a> */
<a name="line937"></a>goog.fx.DragListGroup.prototype.insertCurrHoverItem = function() {
<a name="line938"></a>  this.origList_.insertBefore(this.currDragItem_, this.currHoverItem_);
<a name="line939"></a>};
<a name="line940"></a>
<a name="line941"></a>
<a name="line942"></a>/**
<a name="line943"></a> * Helper for handleDragMove_().
<a name="line944"></a> * Given the position of the center of the dragger element, plus the drag list
<a name="line945"></a> * that it&#39;s currently hovering over, figures out the next drag item in the
<a name="line946"></a> * list that follows the current position of the dragger element. (I.e. if
<a name="line947"></a> * the drag action ends right now, it would become the item after the current
<a name="line948"></a> * drag item.)
<a name="line949"></a> *
<a name="line950"></a> * @param {Element} hoverList The drag list that we&#39;re hovering over.
<a name="line951"></a> * @param {goog.math.Coordinate} draggerElCenter The center position of the
<a name="line952"></a> *     dragger element.
<a name="line953"></a> * @return {Element} Returns the earliest item in the hover list that belongs
<a name="line954"></a> *     after the current position of the dragger element. If all items in the
<a name="line955"></a> *     list should come before the current drag item, then returns null.
<a name="line956"></a> * @private
<a name="line957"></a> */
<a name="line958"></a>goog.fx.DragListGroup.prototype.getHoverNextItem_ = function(
<a name="line959"></a>    hoverList, draggerElCenter) {
<a name="line960"></a>  if (hoverList == null) {
<a name="line961"></a>    throw Error(&#39;getHoverNextItem_ called with null hoverList.&#39;);
<a name="line962"></a>  }
<a name="line963"></a>
<a name="line964"></a>  // The definition of what it means for the draggerEl to be &quot;before&quot; a given
<a name="line965"></a>  // item in the hover drag list is not always the same. It changes based on
<a name="line966"></a>  // the growth direction of the hover drag list in question.
<a name="line967"></a>  /** @type {number} */
<a name="line968"></a>  var relevantCoord;
<a name="line969"></a>  var getRelevantBoundFn;
<a name="line970"></a>  var isBeforeFn;
<a name="line971"></a>  var pickClosestRow = false;
<a name="line972"></a>  var distanceToClosestRow = undefined;
<a name="line973"></a>  switch (hoverList.dlgGrowthDirection_) {
<a name="line974"></a>    case goog.fx.DragListDirection.DOWN:
<a name="line975"></a>      // &quot;Before&quot; means draggerElCenter.y is less than item&#39;s bottom y-value.
<a name="line976"></a>      relevantCoord = draggerElCenter.y;
<a name="line977"></a>      getRelevantBoundFn = goog.fx.DragListGroup.getBottomBound_;
<a name="line978"></a>      isBeforeFn = goog.fx.DragListGroup.isLessThan_;
<a name="line979"></a>      break;
<a name="line980"></a>    case goog.fx.DragListDirection.RIGHT_2D:
<a name="line981"></a>      pickClosestRow = true;
<a name="line982"></a>    case goog.fx.DragListDirection.RIGHT:
<a name="line983"></a>      // &quot;Before&quot; means draggerElCenter.x is less than item&#39;s right x-value.
<a name="line984"></a>      relevantCoord = draggerElCenter.x;
<a name="line985"></a>      getRelevantBoundFn = goog.fx.DragListGroup.getRightBound_;
<a name="line986"></a>      isBeforeFn = goog.fx.DragListGroup.isLessThan_;
<a name="line987"></a>      break;
<a name="line988"></a>    case goog.fx.DragListDirection.LEFT_2D:
<a name="line989"></a>      pickClosestRow = true;
<a name="line990"></a>    case goog.fx.DragListDirection.LEFT:
<a name="line991"></a>      // &quot;Before&quot; means draggerElCenter.x is greater than item&#39;s left x-value.
<a name="line992"></a>      relevantCoord = draggerElCenter.x;
<a name="line993"></a>      getRelevantBoundFn = goog.fx.DragListGroup.getLeftBound_;
<a name="line994"></a>      isBeforeFn = goog.fx.DragListGroup.isGreaterThan_;
<a name="line995"></a>      break;
<a name="line996"></a>  }
<a name="line997"></a>
<a name="line998"></a>  // This holds the earliest drag item found so far that should come after
<a name="line999"></a>  // this.currDragItem_ in the hover drag list (based on draggerElCenter).
<a name="line1000"></a>  var earliestAfterItem = null;
<a name="line1001"></a>  // This is the position of the relevant bound for the earliestAfterItem,
<a name="line1002"></a>  // where &quot;relevant&quot; is determined by the growth direction of hoverList.
<a name="line1003"></a>  var earliestAfterItemRelevantBound;
<a name="line1004"></a>
<a name="line1005"></a>  var hoverListItems = goog.dom.getChildren(hoverList);
<a name="line1006"></a>  for (var i = 0, n = hoverListItems.length; i &lt; n; i++) {
<a name="line1007"></a>    var item = hoverListItems[i];
<a name="line1008"></a>    if (item == this.currDragItem_) {
<a name="line1009"></a>      continue;
<a name="line1010"></a>    }
<a name="line1011"></a>
<a name="line1012"></a>    var relevantBound = getRelevantBoundFn(item.dlgBounds_);
<a name="line1013"></a>    // When the hoverlist is broken into multiple rows (i.e., in the case of
<a name="line1014"></a>    // LEFT_2D and RIGHT_2D) it is no longer enough to only look at the
<a name="line1015"></a>    // x-coordinate alone in order to find the {@earliestAfterItem} in the
<a name="line1016"></a>    // hoverlist. Make sure it is chosen from the row closest to the
<a name="line1017"></a>    // {@code draggerElCenter}.
<a name="line1018"></a>    if (pickClosestRow) {
<a name="line1019"></a>      var distanceToRow = goog.fx.DragListGroup.verticalDistanceFromItem_(item,
<a name="line1020"></a>          draggerElCenter);
<a name="line1021"></a>      // Initialize the distance to the closest row to the current value if
<a name="line1022"></a>      // undefined.
<a name="line1023"></a>      if (!goog.isDef(distanceToClosestRow)) {
<a name="line1024"></a>        distanceToClosestRow = distanceToRow;
<a name="line1025"></a>      }
<a name="line1026"></a>      if (isBeforeFn(relevantCoord, relevantBound) &amp;&amp;
<a name="line1027"></a>          (earliestAfterItemRelevantBound == undefined ||
<a name="line1028"></a>           (distanceToRow &lt; distanceToClosestRow) ||
<a name="line1029"></a>           ((distanceToRow == distanceToClosestRow) &amp;&amp;
<a name="line1030"></a>            (isBeforeFn(relevantBound, earliestAfterItemRelevantBound) ||
<a name="line1031"></a>            relevantBound == earliestAfterItemRelevantBound)))) {
<a name="line1032"></a>        earliestAfterItem = item;
<a name="line1033"></a>        earliestAfterItemRelevantBound = relevantBound;
<a name="line1034"></a>      }
<a name="line1035"></a>      // Update distance to closest row.
<a name="line1036"></a>      if (distanceToRow &lt; distanceToClosestRow) {
<a name="line1037"></a>        distanceToClosestRow = distanceToRow;
<a name="line1038"></a>      }
<a name="line1039"></a>    } else if (isBeforeFn(relevantCoord, relevantBound) &amp;&amp;
<a name="line1040"></a>        (earliestAfterItemRelevantBound == undefined ||
<a name="line1041"></a>         isBeforeFn(relevantBound, earliestAfterItemRelevantBound))) {
<a name="line1042"></a>      earliestAfterItem = item;
<a name="line1043"></a>      earliestAfterItemRelevantBound = relevantBound;
<a name="line1044"></a>    }
<a name="line1045"></a>  }
<a name="line1046"></a>  // If we ended up picking an element that is not in the closest row it can
<a name="line1047"></a>  // only happen if we should have picked the last one in which case there is
<a name="line1048"></a>  // no consecutive element.
<a name="line1049"></a>  if (!goog.isNull(earliestAfterItem) &amp;&amp;
<a name="line1050"></a>      goog.fx.DragListGroup.verticalDistanceFromItem_(
<a name="line1051"></a>          earliestAfterItem, draggerElCenter) &gt; distanceToClosestRow) {
<a name="line1052"></a>    return null;
<a name="line1053"></a>  } else {
<a name="line1054"></a>    return earliestAfterItem;
<a name="line1055"></a>  }
<a name="line1056"></a>};
<a name="line1057"></a>
<a name="line1058"></a>
<a name="line1059"></a>/**
<a name="line1060"></a> * Private helper for getHoverNextItem().
<a name="line1061"></a> * Given an item and a target determine the vertical distance from the item&#39;s
<a name="line1062"></a> * center to the target.
<a name="line1063"></a> * @param {Element} item The item to measure the distance from.
<a name="line1064"></a> * @param {goog.math.Coordinate} target The (x,y) coordinate of the target
<a name="line1065"></a> *     to measure the distance to.
<a name="line1066"></a> * @return {number} The vertical distance between the center of the item and
<a name="line1067"></a> *     the target.
<a name="line1068"></a> * @private
<a name="line1069"></a> */
<a name="line1070"></a>goog.fx.DragListGroup.verticalDistanceFromItem_ = function(item, target) {
<a name="line1071"></a>  var itemBounds = item.dlgBounds_;
<a name="line1072"></a>  var itemCenterY = itemBounds.top + (itemBounds.height - 1) / 2;
<a name="line1073"></a>  return Math.abs(target.y - itemCenterY);
<a name="line1074"></a>};
<a name="line1075"></a>
<a name="line1076"></a>
<a name="line1077"></a>/**
<a name="line1078"></a> * Private helper for getHoverNextItem_().
<a name="line1079"></a> * Given the bounds of an item, computes the item&#39;s bottom y-value.
<a name="line1080"></a> * @param {goog.math.Rect} itemBounds The bounds of the item.
<a name="line1081"></a> * @return {number} The item&#39;s bottom y-value.
<a name="line1082"></a> * @private
<a name="line1083"></a> */
<a name="line1084"></a>goog.fx.DragListGroup.getBottomBound_ = function(itemBounds) {
<a name="line1085"></a>  return itemBounds.top + itemBounds.height - 1;
<a name="line1086"></a>};
<a name="line1087"></a>
<a name="line1088"></a>
<a name="line1089"></a>/**
<a name="line1090"></a> * Private helper for getHoverNextItem_().
<a name="line1091"></a> * Given the bounds of an item, computes the item&#39;s right x-value.
<a name="line1092"></a> * @param {goog.math.Rect} itemBounds The bounds of the item.
<a name="line1093"></a> * @return {number} The item&#39;s right x-value.
<a name="line1094"></a> * @private
<a name="line1095"></a> */
<a name="line1096"></a>goog.fx.DragListGroup.getRightBound_ = function(itemBounds) {
<a name="line1097"></a>  return itemBounds.left + itemBounds.width - 1;
<a name="line1098"></a>};
<a name="line1099"></a>
<a name="line1100"></a>
<a name="line1101"></a>/**
<a name="line1102"></a> * Private helper for getHoverNextItem_().
<a name="line1103"></a> * Given the bounds of an item, computes the item&#39;s left x-value.
<a name="line1104"></a> * @param {goog.math.Rect} itemBounds The bounds of the item.
<a name="line1105"></a> * @return {number} The item&#39;s left x-value.
<a name="line1106"></a> * @private
<a name="line1107"></a> */
<a name="line1108"></a>goog.fx.DragListGroup.getLeftBound_ = function(itemBounds) {
<a name="line1109"></a>  return itemBounds.left || 0;
<a name="line1110"></a>};
<a name="line1111"></a>
<a name="line1112"></a>
<a name="line1113"></a>/**
<a name="line1114"></a> * Private helper for getHoverNextItem_().
<a name="line1115"></a> * @param {number} a Number to compare.
<a name="line1116"></a> * @param {number} b Number to compare.
<a name="line1117"></a> * @return {boolean} Whether a is less than b.
<a name="line1118"></a> * @private
<a name="line1119"></a> */
<a name="line1120"></a>goog.fx.DragListGroup.isLessThan_ = function(a, b) {
<a name="line1121"></a>  return a &lt; b;
<a name="line1122"></a>};
<a name="line1123"></a>
<a name="line1124"></a>
<a name="line1125"></a>/**
<a name="line1126"></a> * Private helper for getHoverNextItem_().
<a name="line1127"></a> * @param {number} a Number to compare.
<a name="line1128"></a> * @param {number} b Number to compare.
<a name="line1129"></a> * @return {boolean} Whether a is greater than b.
<a name="line1130"></a> * @private
<a name="line1131"></a> */
<a name="line1132"></a>goog.fx.DragListGroup.isGreaterThan_ = function(a, b) {
<a name="line1133"></a>  return a &gt; b;
<a name="line1134"></a>};
<a name="line1135"></a>
<a name="line1136"></a>
<a name="line1137"></a>/**
<a name="line1138"></a> * Inserts the current drag item to the appropriate location in the drag list
<a name="line1139"></a> * that we&#39;re hovering over (if the current drag item is not already there).
<a name="line1140"></a> *
<a name="line1141"></a> * @param {Element} hoverList The drag list we&#39;re hovering over.
<a name="line1142"></a> * @param {Element} hoverNextItem The next item in the hover drag list.
<a name="line1143"></a> * @private
<a name="line1144"></a> */
<a name="line1145"></a>goog.fx.DragListGroup.prototype.insertCurrDragItem_ = function(
<a name="line1146"></a>    hoverList, hoverNextItem) {
<a name="line1147"></a>  if (this.currDragItem_.parentNode != hoverList ||
<a name="line1148"></a>      goog.dom.getNextElementSibling(this.currDragItem_) != hoverNextItem) {
<a name="line1149"></a>    // The current drag item is not in the correct location, so we move it.
<a name="line1150"></a>    // Note: hoverNextItem may be null, but insertBefore() still works.
<a name="line1151"></a>    hoverList.insertBefore(this.currDragItem_, hoverNextItem);
<a name="line1152"></a>  }
<a name="line1153"></a>};
<a name="line1154"></a>
<a name="line1155"></a>
<a name="line1156"></a>/**
<a name="line1157"></a> * Note: Copied from abstractdragdrop.js. TODO(user): consolidate.
<a name="line1158"></a> * Creates copy of node being dragged.
<a name="line1159"></a> *
<a name="line1160"></a> * @param {Element} sourceEl Element to copy.
<a name="line1161"></a> * @return {Element} The clone of {@code sourceEl}.
<a name="line1162"></a> * @private
<a name="line1163"></a> */
<a name="line1164"></a>goog.fx.DragListGroup.prototype.cloneNode_ = function(sourceEl) {
<a name="line1165"></a>  var clonedEl = /** @type {Element} */ (sourceEl.cloneNode(true));
<a name="line1166"></a>  switch (sourceEl.tagName.toLowerCase()) {
<a name="line1167"></a>    case &#39;tr&#39;:
<a name="line1168"></a>      return goog.dom.createDom(
<a name="line1169"></a>          &#39;table&#39;, null, goog.dom.createDom(&#39;tbody&#39;, null, clonedEl));
<a name="line1170"></a>    case &#39;td&#39;:
<a name="line1171"></a>    case &#39;th&#39;:
<a name="line1172"></a>      return goog.dom.createDom(
<a name="line1173"></a>          &#39;table&#39;, null, goog.dom.createDom(&#39;tbody&#39;, null, goog.dom.createDom(
<a name="line1174"></a>          &#39;tr&#39;, null, clonedEl)));
<a name="line1175"></a>    default:
<a name="line1176"></a>      return clonedEl;
<a name="line1177"></a>  }
<a name="line1178"></a>};
<a name="line1179"></a>
<a name="line1180"></a>
<a name="line1181"></a>
<a name="line1182"></a>/**
<a name="line1183"></a> * The event object dispatched by DragListGroup.
<a name="line1184"></a> * The fields draggerElCenter, hoverList, and hoverNextItem are only available
<a name="line1185"></a> * for the BEFOREDRAGMOVE and DRAGMOVE events.
<a name="line1186"></a> *
<a name="line1187"></a> * @param {string} type The event type string.
<a name="line1188"></a> * @param {goog.fx.DragListGroup} dragListGroup A reference to the associated
<a name="line1189"></a> *     DragListGroup object.
<a name="line1190"></a> * @param {goog.events.BrowserEvent|goog.fx.DragEvent} event The event fired
<a name="line1191"></a> *     by the browser or fired by the dragger.
<a name="line1192"></a> * @param {Element} currDragItem The current drag item being moved.
<a name="line1193"></a> * @param {Element} draggerEl The clone of the current drag item that&#39;s actually
<a name="line1194"></a> *     being dragged around.
<a name="line1195"></a> * @param {goog.fx.Dragger} dragger The dragger object.
<a name="line1196"></a> * @param {goog.math.Coordinate=} opt_draggerElCenter The current center
<a name="line1197"></a> *     position of the draggerEl.
<a name="line1198"></a> * @param {Element=} opt_hoverList The current drag list that&#39;s being hovered
<a name="line1199"></a> *     over, or null if the center of draggerEl is outside of any drag lists.
<a name="line1200"></a> *     If not null and the drag action ends right now, then currDragItem will
<a name="line1201"></a> *     end up in this list.
<a name="line1202"></a> * @param {Element=} opt_hoverNextItem The current next item in the hoverList
<a name="line1203"></a> *     that the draggerEl is hovering over. (I.e. If the drag action ends
<a name="line1204"></a> *     right now, then this item would become the next item after the new
<a name="line1205"></a> *     location of currDragItem.) May be null if not applicable or if
<a name="line1206"></a> *     currDragItem would be added to the end of hoverList.
<a name="line1207"></a> * @constructor
<a name="line1208"></a> * @extends {goog.events.Event}
<a name="line1209"></a> */
<a name="line1210"></a>goog.fx.DragListGroupEvent = function(
<a name="line1211"></a>    type, dragListGroup, event, currDragItem, draggerEl, dragger,
<a name="line1212"></a>    opt_draggerElCenter, opt_hoverList, opt_hoverNextItem) {
<a name="line1213"></a>  goog.events.Event.call(this, type);
<a name="line1214"></a>
<a name="line1215"></a>  /**
<a name="line1216"></a>   * A reference to the associated DragListGroup object.
<a name="line1217"></a>   * @type {goog.fx.DragListGroup}
<a name="line1218"></a>   */
<a name="line1219"></a>  this.dragListGroup = dragListGroup;
<a name="line1220"></a>
<a name="line1221"></a>  /**
<a name="line1222"></a>   * The event fired by the browser or fired by the dragger.
<a name="line1223"></a>   * @type {goog.events.BrowserEvent|goog.fx.DragEvent}
<a name="line1224"></a>   */
<a name="line1225"></a>  this.event = event;
<a name="line1226"></a>
<a name="line1227"></a>  /**
<a name="line1228"></a>   * The current drag item being move.
<a name="line1229"></a>   * @type {Element}
<a name="line1230"></a>   */
<a name="line1231"></a>  this.currDragItem = currDragItem;
<a name="line1232"></a>
<a name="line1233"></a>  /**
<a name="line1234"></a>   * The clone of the current drag item that&#39;s actually being dragged around.
<a name="line1235"></a>   * @type {Element}
<a name="line1236"></a>   */
<a name="line1237"></a>  this.draggerEl = draggerEl;
<a name="line1238"></a>
<a name="line1239"></a>  /**
<a name="line1240"></a>   * The dragger object.
<a name="line1241"></a>   * @type {goog.fx.Dragger}
<a name="line1242"></a>   */
<a name="line1243"></a>  this.dragger = dragger;
<a name="line1244"></a>
<a name="line1245"></a>  /**
<a name="line1246"></a>   * The current center position of the draggerEl.
<a name="line1247"></a>   * @type {goog.math.Coordinate|undefined}
<a name="line1248"></a>   */
<a name="line1249"></a>  this.draggerElCenter = opt_draggerElCenter;
<a name="line1250"></a>
<a name="line1251"></a>  /**
<a name="line1252"></a>   * The current drag list that&#39;s being hovered over, or null if the center of
<a name="line1253"></a>   * draggerEl is outside of any drag lists. (I.e. If not null and the drag
<a name="line1254"></a>   * action ends right now, then currDragItem will end up in this list.)
<a name="line1255"></a>   * @type {Element|undefined}
<a name="line1256"></a>   */
<a name="line1257"></a>  this.hoverList = opt_hoverList;
<a name="line1258"></a>
<a name="line1259"></a>  /**
<a name="line1260"></a>   * The current next item in the hoverList that the draggerEl is hovering over.
<a name="line1261"></a>   * (I.e. If the drag action ends right now, then this item would become the
<a name="line1262"></a>   * next item after the new location of currDragItem.) May be null if not
<a name="line1263"></a>   * applicable or if currDragItem would be added to the end of hoverList.
<a name="line1264"></a>   * @type {Element|undefined}
<a name="line1265"></a>   */
<a name="line1266"></a>  this.hoverNextItem = opt_hoverNextItem;
<a name="line1267"></a>};
<a name="line1268"></a>goog.inherits(goog.fx.DragListGroupEvent, goog.events.Event);
</pre>


</body>
</html>
